{*******************************************************************************
* The contents of this file are used with permission, subject to the Mozilla   *
* Public License Version 1.1 (the "License"); you may not use this file except *
* in compliance with the License. You may obtain a copy of the License at      *
* http://www.mozilla.org/MPL/                                                  *
*                                                                              *
* Software distributed under the License is distributed on an "AS IS" basis,   *
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for *
* the specific language governing rights and limitations under the License.    *
*                                                                              *
* The Original Code is distributed as part of the "mediate" product and is     *
* Copyright (C) @home media limited. All Rights Reserved.                      *
*                                                                              *
* Email: support@athomemedia.co.uk                                             *
* Web:   http://www.athomemedia.co.uk                                          *
*******************************************************************************}

unit WeatherConsts;

interface

uses MetaConsts;

const
  // Weather plugin specific action/event names
  EVENT_WEATHER_CONFIGURE = 'plugin.weather.configure';
  EVENT_SEARCH_WEATHER = 'plugin.weather.search';
  EVENT_SEARCH_COMPLETE = 'plugin.weather.search.complete';
  EVENT_WEATHER_UPDATED = 'plugin.weather.updated';
  EVENT_WEATHER_FAILED = 'plugin.weather.failed';
  EVENT_WEATHER_NOLOCN = 'plugin.weather.notconfigured';

  // Weather plugin specific text names
  TEXT_WEATHER_CONFIG_METRIC = 'plugin.weather.metric';
  TEXT_WEATHER_CONFIG_IMPERIAL = 'plugin.weather.imperial';

  // Weather plugin specific metadata names
  META_WEATHER = 'weather';

  META_WEATHER_CONFIG = META_WEATHER + META_SEP + 'configuration';
  META_WEATHER_CONFIG_LOCATION_ID = META_WEATHER_CONFIG + META_SEP + 'locationid';
  META_WEATHER_CONFIG_LOCATION_NAME = META_WEATHER_CONFIG + META_SEP + 'locationname';
  META_WEATHER_CONFIG_UNIT = META_WEATHER_CONFIG + META_SEP + 'unit';
  META_WEATHER_CONFIG_UNITS = META_WEATHER_CONFIG + META_SEP + 'units';
  META_WEATHER_CONFIG_UNITS_METRIC = META_WEATHER_CONFIG_UNITS + META_SEP + 'metric';
  META_WEATHER_CONFIG_UNITS_IMPERIAL = META_WEATHER_CONFIG_UNITS + META_SEP + 'imperial';
  META_WEATHER_CONFIG_METRIC = 'metric';
  META_WEATHER_CONFIG_IMPERIAL = 'imperial';

  META_WEATHER_SEARCH = META_WEATHER + META_SEP + 'search';
  META_WEATHER_SEARCH_LOCATION = META_WEATHER_SEARCH + META_SEP + 'location';
  META_WEATHER_SEARCH_STATUS = META_WEATHER_SEARCH + META_SEP + 'status';
  META_WEATHER_SEARCH_RESULTS = META_WEATHER_SEARCH + META_SEP + 'results';
  META_WEATHER_SEARCH_RESULT = META_WEATHER_SEARCH_RESULTS + META_SEP + META_INDEX;
  META_WEATHER_SEARCH_ID = 'id';
  META_WEATHER_SEARCH_NAME = 'name';

  META_WEATHER_LINKS = META_WEATHER + META_SEP + 'links';
  META_WEATHER_LINKS_LINK = META_WEATHER_LINKS + META_SEP + META_INDEX;
  META_WEATHER_LINKS_URL = 'url';
  META_WEATHER_LINKS_TEXT = 'description';

  META_WEATHER_LOCATION = META_WEATHER + META_SEP + 'location';
  META_WEATHER_LOCATION_ID = META_WEATHER_LOCATION + META_SEP + 'id';
  META_WEATHER_LOCATION_NAME = META_WEATHER_LOCATION + META_SEP + 'name';
  META_WEATHER_LOCATION_LATT = META_WEATHER_LOCATION + META_SEP + 'lattitude';
  META_WEATHER_LOCATION_LONG = META_WEATHER_LOCATION + META_SEP + 'longitude';
  META_WEATHER_LOCATION_TIMEZONE = META_WEATHER_LOCATION + META_SEP + 'timezone';
  META_WEATHER_LOCATION_CURRTIME = META_WEATHER_LOCATION + META_SEP + 'currenttime';
  META_WEATHER_LOCATION_OBSERV = META_WEATHER_LOCATION + META_SEP + 'observatory';
  META_WEATHER_LOCATION_SUNRISE = META_WEATHER_LOCATION + META_SEP + 'sunrise';
  META_WEATHER_LOCATION_SUNSET = META_WEATHER_LOCATION + META_SEP + 'sunset';

  META_WEATHER_CURRENT = META_WEATHER + META_SEP + 'current';
  META_WEATHER_CURRENT_LASTUPDATE = META_WEATHER_CURRENT + META_SEP + 'lastupdated';
  META_WEATHER_CURRENT_ACT_TEMP = META_WEATHER_CURRENT + META_SEP + 'temperature';
  META_WEATHER_CURRENT_PER_TEMP = META_WEATHER_CURRENT + META_SEP + 'feelslike';
  META_WEATHER_CURRENT_PRESSURE = META_WEATHER_CURRENT + META_SEP + 'pressure';
  META_WEATHER_CURRENT_PRESCHNG = META_WEATHER_CURRENT + META_SEP + 'pressurechange';
  META_WEATHER_CURRENT_VISIBILITY = META_WEATHER_CURRENT + META_SEP + 'visibility';
  META_WEATHER_CURRENT_UVINDEX = META_WEATHER_CURRENT + META_SEP + 'uvindex';
  META_WEATHER_CURRENT_UVDESCR = META_WEATHER_CURRENT + META_SEP + 'uvdescription';
  META_WEATHER_CURRENT_DEWPOINT = META_WEATHER_CURRENT + META_SEP + 'dewpoint';
  META_WEATHER_CURRENT_MOONIMG = META_WEATHER_CURRENT + META_SEP + 'moonimage';
  META_WEATHER_CURRENT_MOONDESCR = META_WEATHER_CURRENT + META_SEP + 'moondescription';
  META_WEATHER_CURRENT_IMAGE = META_WEATHER_CURRENT + META_SEP + 'image';
  META_WEATHER_CURRENT_DESCRIPTION = META_WEATHER_CURRENT + META_SEP + 'description';
  META_WEATHER_CURRENT_WINDSPEED = META_WEATHER_CURRENT + META_SEP + 'windspeed';
  META_WEATHER_CURRENT_WINDGUSTS = META_WEATHER_CURRENT + META_SEP + 'windgusts';
  META_WEATHER_CURRENT_WINDDIRECT = META_WEATHER_CURRENT + META_SEP + 'winddirection';
  META_WEATHER_CURRENT_HUMIDITY = META_WEATHER_CURRENT + META_SEP + 'humidity';

  META_WEATHER_FORECAST = META_WEATHER + META_SEP + 'forecast';
  META_WEATHER_FORECAST_LASTUPDATE = META_WEATHER_FORECAST + META_SEP + 'lastupdated';
  META_WEATHER_FORECAST_DAYS = META_WEATHER_FORECAST + META_SEP + 'days';
  META_WEATHER_FORECAST_FORECAST = META_WEATHER_FORECAST_DAYS + META_SEP + META_INDEX;
  META_WEATHER_FORECAST_DAY = 'day';
  META_WEATHER_FORECAST_DATE = 'date';
  META_WEATHER_FORECAST_TEMP_HI = 'maximumtemp';
  META_WEATHER_FORECAST_TEMP_LO = 'minimumtemp';
  META_WEATHER_FORECAST_SUNRISE = 'sunrise';
  META_WEATHER_FORECAST_SUNSET = 'sunset';
  META_WEATHER_FORECAST_AM = 'am' + META_SEP;
  META_WEATHER_FORECAST_PM = 'pm' + META_SEP;
  META_WEATHER_FORECAST_IMAGE = 'image';
  META_WEATHER_FORECAST_DESCRIPTION = 'description';
  META_WEATHER_FORECAST_WINDSPEED = 'windspeed';
  META_WEATHER_FORECAST_WINDGUSTS = 'windgusts';
  META_WEATHER_FORECAST_WINDDIRECT = 'winddirection';
  META_WEATHER_FORECAST_HUMIDITY = 'humidity';
  META_WEATHER_FORECAST_RAINLIKELY = 'rainlikelihood';

  // Standard image names for weather forecasts
  IMG_STORM = 'storm';
  IMG_SNOW_SHOWERS = 'snow showers';
  IMG_HAIL_SHOWERS = 'hail showers';
  IMG_HAIL = 'hail';
  IMG_FOG = 'fog';
  IMG_RAIN = 'rain';
  IMG_SNOW = 'snow';
  IMG_DUST = 'dust';
  IMG_HAZE = 'haze';
  IMG_SMOKE = 'smoke';
  IMG_WINDY = 'windy';
  IMG_FRIGID = 'frigid';
  IMG_CLOUDY = 'cloudy';
  IMG_PARTLY_CLOUDY = 'partly cloudy';
  IMG_CLEAR = 'clear';
  IMG_SUNNY = 'sunny';
  IMG_SHOWERS = 'showers';
  IMG_NA = 'na';

  // Weather.com HTTP request URLs
  URL_WEATHERDOTCOM_HOST     = 'http://xoap.weather.com/';
  URL_WEATHERDOTCOM_LOCATION = URL_WEATHERDOTCOM_HOST + 'search/search?where=%0:s';
  URL_WEATHERDOTCOM_BASE     = URL_WEATHERDOTCOM_HOST + 'weather/local/%0:s?par=%1:s&key=%2:s&prod=xoap&unit=%3:s';
  URL_WEATHERDOTCOM_CURRENT  = '&cc=*';
  URL_WEATHERDOTCOM_FORECAST = '&dayf=%0:d';
  URL_WEATHERDOTCOM_LINKS    = '&link=xoap';
  URL_PARAM_WEATHERDOTCOM_METRIC   = 'm';
  URL_PARAM_WEATHERDOTCOM_STANDARD = 's';

  // Weather.com Location search XML tags
  TAG_WEATHERDOTCOM_SEARCH      = 'search';
  TAG_WEATHERDOTCOM_LOCATION    = 'loc';
  TAG_WEATHERDOTCOM_WEATHER     = 'weather';
  TAG_WEATHERDOTCOM_HEADER      = 'head';
  TAG_WEATHERDOTCOM_CURRENT     = 'cc';

  // Weather.com Header XML tags
  TAG_WEATHERDOTCOM_UNITOFTEMP  = 'ut';
  TAG_WEATHERDOTCOM_UNITOFDIST  = 'ud';
  TAG_WEATHERDOTCOM_UNITOFSPEED = 'us';
  TAG_WEATHERDOTCOM_UNITOFRAIN  = 'ur';
  TAG_WEATHERDOTCOM_UNITOFPRES  = 'up';

  // Weather.com Location XML tags
  TAG_WEATHERDOTCOM_ID_ATTR     = 'id';
  TAG_WEATHERDOTCOM_NAME        = 'dnam';
  TAG_WEATHERDOTCOM_CURRENTTIME = 'tm';
  TAG_WEATHERDOTCOM_LATTITUDE   = 'lat';
  TAG_WEATHERDOTCOM_LONGITUDE   = 'lon';
  TAG_WEATHERDOTCOM_SUNRISE     = 'sunr';
  TAG_WEATHERDOTCOM_SUNSET      = 'suns';
  TAG_WEATHERDOTCOM_TIMEZONE    = 'zone';

  // Weather.com Affiliate link XML tags
  TAG_WEATHERDOTCOM_LINKS       = 'lnks';
  TAG_WEATHERDOTCOM_LINK        = 'link';
  TAG_WEATHERDOTCOM_LINKURL     = 'l';
  TAG_WEATHERDOTCOM_LINKTEXT    = 't';

  // Weather.com Current condition XML tags
  TAG_WEATHERDOTCOM_LASTUPDATE  = 'lsup';
  TAG_WEATHERDOTCOM_OBSERVATORY = 'obst';
  TAG_WEATHERDOTCOM_TEMPERATURE = 'tmp';
  TAG_WEATHERDOTCOM_FEELSLIKE   = 'flik';
  TAG_WEATHERDOTCOM_DESCRIPTION = 't';
  TAG_WEATHERDOTCOM_IMAGE       = 'icon';
  TAG_WEATHERDOTCOM_BAROMETER   = 'bar';
  TAG_WEATHERDOTCOM_PRESSURE    = 'r';
  TAG_WEATHERDOTCOM_PRESSURECHG = 'd';
  TAG_WEATHERDOTCOM_WIND        = 'wind';
  TAG_WEATHERDOTCOM_WINDSPEED   = 's';
  TAG_WEATHERDOTCOM_WINDGUST    = 'gust';
  TAG_WEATHERDOTCOM_WINDBEARING = 'd';
  TAG_WEATHERDOTCOM_WINDDIRECTN = 't';
  TAG_WEATHERDOTCOM_HUMIDITY    = 'hmid';
  TAG_WEATHERDOTCOM_VISIBILITY  = 'vis';
  TAG_WEATHERDOTCOM_UV          = 'uv';
  TAG_WEATHERDOTCOM_UVINDEX     = 'i';
  TAG_WEATHERDOTCOM_UVDESCR     = 't';
  TAG_WEATHERDOTCOM_DEWPOINT    = 'dewp';
  TAG_WEATHERDOTCOM_MOON        = 'moon';
  TAG_WEATHERDOTCOM_MOONIMAGE   = 'icon';
  TAG_WEATHERDOTCOM_MOONDESCR   = 't';

  // Weather.com Forecast weather XML tags
  TAG_WEATHERDOTCOM_FORECASTS   = 'dayf';
  TAG_WEATHERDOTCOM_FORECAST    = 'day';
  TAG_WEATHERDOTCOM_DAYNUM_ATTR = 'd';
  TAG_WEATHERDOTCOM_DAY_ATTR    = 't';
  TAG_WEATHERDOTCOM_DATE_ATTR   = 'dt';
  TAG_WEATHERDOTCOM_TEMP_HI     = 'hi';
  TAG_WEATHERDOTCOM_TEMP_LOW    = 'low';
  TAG_WEATHERDOTCOM_DAY_PART    = 'part';
  TAG_WEATHERDOTCOM_AMPM_ATTR   = 'p';
  TAG_WEATHERDOTCOM_CHANCERAIN  = 'ppcp';

implementation


end.
